$("#updateMsgBtn").on("click",function(){
   //null
});

//清除消息
$("#clearMsgBtn").on('click', function() {

   if(conn){
      conn.queryMC("errorhistoryclear",null);//清除普通消息

      var clearDev = setTimeout(function(){
         conn.queryMC("?TP_CLRFAULT",null);//清除设备消息
      },500);
   }
   
});

/* */
var newCount = 0;
var messageNew=[];
var messageNewData;

// 显示信息到面板
function messageShow(result,num){//way2
	//console.log(result);
	result = result.split("\n");
   messageNew='';
   result.reverse();
	for (var i=1; i<result.length-3; i++) {
		newCount++;
		var index = result[i].indexOf('\"');
		var data = result[i].substr(0,index).split(" ");
		var parts = [];
		data.forEach(function(str){
			if (str!=null && str.length>0)
				parts.push(str);
		});	
		var date = parts[0];
		var time = parts[1];
		var severity = parts[2];
		var code = parts[3];
		var task = parts[4];
		var file = parts[5];
		var line = parts[6];
		var module = parts[7];
		var message = result[i].substr(index+1).slice(0,-2);
		for (var j=8; j<parts.length; j++)
			message += parts[j] + " ";
		var color,icon;
		messageNewData=code+":"+message;

		messageNew+='<div id=""><p>'+messageNewData+'</p></div>';
	}
	$("#news_content").html(messageNew);	
}
